/*    */ package com.zimbra.cs.account.callback;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.DateUtil;
/*    */ import com.zimbra.cs.account.AttributeCallback;
/*    */ import com.zimbra.cs.account.AttributeCallback.SingleValueMod;
/*    */ import com.zimbra.cs.account.Entry;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PositiveTimeInterval
/*    */   extends AttributeCallback
/*    */ {
/*    */   public void preModify(CallbackContext context, String attrName, Object attrValue, Map attrsToModify, Entry entry)
/*    */     throws ServiceException
/*    */   {
/* 33 */     AttributeCallback.SingleValueMod mod = singleValueMod(attrName, attrValue);
/* 34 */     if (mod.setting()) {
/* 35 */       long interval = DateUtil.getTimeInterval(mod.value(), 0L);
/* 36 */       if (interval <= 0L) {
/* 37 */         throw ServiceException.INVALID_REQUEST("cannot set " + attrName + " less than or equal to 0", null);
/*    */       }
/*    */     }
/*    */   }
/*    */   
/*    */   public void postModify(CallbackContext context, String attrName, Entry entry) {}
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/callback/PositiveTimeInterval.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */